package be.bonamis.umpire.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import be.bonamis.umpire.domain.Customer;


public interface CustomerRepository extends JpaRepository<Customer, Integer> {
	Customer findByName(String name);
	
	@Query("SELECT p FROM Customer p join fetch p.dogs WHERE LOWER(p.name) = LOWER(:name)")
    public List<Customer> find(@Param("name") String name);
}
